<template>
  <div class="road-legend-content">
    <p>{{ title }}</p>
    <div class="flex">
      <div v-for="(item, index) in list" :key="index">
        <img :src="item.img" />
        <div class="title">{{ item.title }}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import { defineComponent, reactive, toRefs } from 'vue';
  export default defineComponent({
    props: {
      title: {
        type: String,
        default: '道路公共设施图例',
      },
    },
    setup() {
      const state = reactive({
        list: [
          {
            img: require('@/assets/images/basic/tianqiao.png'),
            title: '过街天桥',
          },
          {
            img: require('@/assets/images/basic/dixiatongdao.png'),
            title: '地下通道',
          },
        ],
      });
      return {
        ...toRefs(state),
      };
    },
  });
</script>

<style lang="less" scoped>
  .road-legend-content {
    color: white;
    width: 100%;
    & > p {
      font-size: 14px;
      color: #fff;
      margin-bottom: 20px;
    }
    .flex {
      display: flex;
      align-items: center;
      & > div {
        display: flex;
        align-items: center;
        margin-right: 30px;
      }
      .title {
        margin-left: 10px;
      }
    }
  }
</style>
